package org.yray.sip.handler.flow;


import lombok.extern.slf4j.Slf4j;
import org.yray.sip.base.MsgType;
import org.yray.sip.base.SipMsg;
import org.yray.sip.creator.MessageCreator;
import org.yray.sip.handler.MessageHandler;
import org.yray.sip.server.SipServerContext;
import org.yray.sip.server.SipSession;


@Slf4j
public class OK_CancelHandler extends MessageHandler {

    public static final OK_CancelHandler instance=new  OK_CancelHandler();


    @Override
    public String[] handler(SipMsg sipMsg, SipServerContext ssc) {
        SipSession sipSession=new SipSession(sipMsg,ssc.getRunIp(),ssc.getRunPort(),false);
        String result= MessageCreator.getCreator(MsgType.ACK).createMsg(sipSession);
        return new String[]{result};
    }
}
